package br.com.cielo.utils;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;

public class LeitorArquivo {
	public String mostra(InputStream instr,int line)
	{
	    int count = 0;
		try{
		     DataInputStream in = new DataInputStream(instr);
		         BufferedReader br = new BufferedReader(new InputStreamReader(in));
		     String strLine;
		     //Read File Line By Line
		     while ((strLine = br.readLine()) != null)   {
		       // Print the content on the console
		       if (count < line) {
		    	   count++;
				   continue;
			   } else {
		    	   return strLine;
			   }
		     }
		     //Close the input stream
		     in.close();
	     }catch (Exception e){//Catch exception if any
	    	 return "Erro: " + e.getMessage();
	     }
		return "Nada";
	}
};
